$(function() {
    var jobid = parent.$("#jobid").val();
    var taskhash = parent.$("#jobtaskid").val();
    var jobblockid = parent.$("#jobblockid").val();

    $.ajax({
        type:"POST",
        url:constUrl+"ws/job/state",
        dataType:"json",
        data: {
            taskHash:taskhash,
            blockId:jobblockid,
            jobId:jobid
        },
        success:function(data){
            addJobDetail(data[0].fullInfo);
        }
    });
});
function addJobDetail(data) {
    $("#job_id").append("<td>"+data.jobId+"</td>");
    $("#owner").append("<td>"+data.executionHost+"</td>");
    $("#status").append("<td>"+data.status+"</td>");
    $("#name").append("<td>"+data.jobName+"</td>");
    $("#queue").append("<td>"+data.queue+"</td>");
    $("#command").append("<td>"+data.command+"</td>");
    $("#priority").append("<td>"+data.priority+"</td>");
    $("#requestGpuNum").append("<td>"+data.requestGpuNum+"</td>");
    $("#bindGPU").append("<td>"+data.bindGPU+"</td>");
    $("#reasons").append("<td>"+data.reasons+"</td>");
    $("#sumRusage").append("<td>"+data.sumRusage+"</td>");
    $("#outFile").append("<td>"+data.outFile+"</td>");
    $("#maxNumProcessors").append("<td>"+data.maxNumProcessors+"</td>");
    $("#numProcessors").append("<td>"+data.numProcessors+"</td>");
    $("#submitTime").append("<td>"+data.submitTime+"</td>");
    $("#executionTime").append("<td>"+data.executionTime+"</td>");
    $("#terminationTime").append("<td>"+data.terminationTime+"</td>");
}
